﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Lk.Common;

namespace Lk.Web
{
    public class PlatForm
    {
    }


    

    internal class DataBaseProvider
    {
        private readonly ApplicationConfiguration dataBaserProvider = new AppConfigurtaionServices().GetAppSettings<ApplicationConfiguration>("siteconfig");
        public bool _isSqlServer
        {
            get
            {
                return dataBaserProvider.DataBase.ToLower() == "mssql";
            }

        }



        public bool _isMySql
        {
            get
            {
                return dataBaserProvider.DataBase.ToLower() == "mysql";
            }
        }



        public bool _isOracle
        {
            get
            {
                return dataBaserProvider.DataBase.ToLower() == "oracle";
            }
        }
        public bool UseRedis
        {
            get
            {
                return dataBaserProvider.DataBase.ToLower() == "UseRedis";
            }
        }

    }
    internal class CacheProvider
    {
        private readonly ApplicationConfiguration dataBaserProvider = new AppConfigurtaionServices().GetAppSettings<ApplicationConfiguration>("CacheConfiguration", "appsettings.json");
        public bool UseRedis
        {
            get
            {
                return dataBaserProvider.UseRedis;
            }

        }

        public string RedisInstanceName
        {
            get
            {
                return dataBaserProvider.Redis_InstanceName;
            }

        }

        public string RedisConnectionString
        {
            get
            {
                return dataBaserProvider.Redis_ConnectionString;
            }

        }
    }
}
